package observe;

import java.util.ArrayList;
import java.util.List;

public class BeingObserve {
    //定义观察者列表
        List<Observe> observeList=new ArrayList<>();

        public void excute(){
            observeList.stream().forEach(observe->{
                observe.excute();
            });
        }

        public void addObserve(Observe observe){
            observeList.add(observe);
        }
}
